package com.mfc.education.service.base.exception;

import com.mfc.education.common.base.result.ResultCodeEnum;
import lombok.Data;

/**
 * @author mfc
 * @since 2021/9/3
 */

@Data
public class EduException extends RuntimeException {

    private Integer code;

    public EduException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public EduException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();

    }

    @Override
    public String toString() {
        return "EduException{" +
                "code=" + code +
                "，message=" + this.getMessage() +
                '}';
    }
}
